//
//  Country.m
//  ImGuider
//
//  Created by llt on 2017/4/24.
//  Copyright © 2017年 imguider. All rights reserved.
//

#import "Country.h"

@implementation Country

+ (NSDictionary *)modelCustomPropertyMapper {
    
    return @{@"cid" : @"id"};
}


- (NSString *)smartName {
    
    //    en
    //    zh-Hans-US
    //    zh-Hant-US
    //    zh-Hant-TW
    
    //    if ([[AppManager sharedManager].language containsString:@"en"]) {
    //        return _ename;
    //    } else {
    //        return _name;
    //    }
    
    
    NSString *name = @"";
    if ([[AppManager sharedManager].language hasPrefix:@"zh-Hans"]) {
        
        name = _country;
    } else if ([[AppManager sharedManager].language hasPrefix:@"zh-Hant"]) {
        
        name = _fname;
    }else {
        
        name = _ename;
    }
    
    if (name.length == 0) {
        name = _country;
    }
    return name;
}

@end
